<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - id:000977,sync:fuzzer2,src:001052.lcov_info_final - test/gmock-1.7.0/gtest/include/gtest/gtest-printers.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../../index.html">top level</a> - <a href="index.html">test/gmock-1.7.0/gtest/include/gtest</a> - gtest-printers.h<span style="font-size: 80%;"> (source / <a href="gtest-printers.h.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">id:000977,sync:fuzzer2,src:001052.lcov_info_final</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">110</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2016-03-13 10:42:47</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">164</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr><td><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Copyright 2007, Google Inc.</a>
<span class="lineNum">       2 </span>            : // All rights reserved.
<span class="lineNum">       3 </span>            : //
<span class="lineNum">       4 </span>            : // Redistribution and use in source and binary forms, with or without
<span class="lineNum">       5 </span>            : // modification, are permitted provided that the following conditions are
<span class="lineNum">       6 </span>            : // met:
<span class="lineNum">       7 </span>            : //
<span class="lineNum">       8 </span>            : //     * Redistributions of source code must retain the above copyright
<span class="lineNum">       9 </span>            : // notice, this list of conditions and the following disclaimer.
<span class="lineNum">      10 </span>            : //     * Redistributions in binary form must reproduce the above
<span class="lineNum">      11 </span>            : // copyright notice, this list of conditions and the following disclaimer
<span class="lineNum">      12 </span>            : // in the documentation and/or other materials provided with the
<span class="lineNum">      13 </span>            : // distribution.
<span class="lineNum">      14 </span>            : //     * Neither the name of Google Inc. nor the names of its
<span class="lineNum">      15 </span>            : // contributors may be used to endorse or promote products derived from
<span class="lineNum">      16 </span>            : // this software without specific prior written permission.
<span class="lineNum">      17 </span>            : //
<span class="lineNum">      18 </span>            : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<span class="lineNum">      19 </span>            : // &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<span class="lineNum">      20 </span>            : // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
<span class="lineNum">      21 </span>            : // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
<span class="lineNum">      22 </span>            : // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
<span class="lineNum">      23 </span>            : // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
<span class="lineNum">      24 </span>            : // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
<span class="lineNum">      25 </span>            : // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
<span class="lineNum">      26 </span>            : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<span class="lineNum">      27 </span>            : // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<span class="lineNum">      28 </span>            : // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<span class="lineNum">      29 </span>            : //
<span class="lineNum">      30 </span>            : // Author: wan@google.com (Zhanyong Wan)
<span class="lineNum">      31 </span>            : 
<span class="lineNum">      32 </span>            : // Google Test - The Google C++ Testing Framework
<span class="lineNum">      33 </span>            : //
<span class="lineNum">      34 </span>            : // This file implements a universal value printer that can print a
<span class="lineNum">      35 </span>            : // value of any type T:
<span class="lineNum">      36 </span>            : //
<span class="lineNum">      37 </span>            : //   void ::testing::internal::UniversalPrinter&lt;T&gt;::Print(value, ostream_ptr);
<span class="lineNum">      38 </span>            : //
<span class="lineNum">      39 </span>            : // A user can teach this function how to print a class type T by
<span class="lineNum">      40 </span>            : // defining either operator&lt;&lt;() or PrintTo() in the namespace that
<span class="lineNum">      41 </span>            : // defines T.  More specifically, the FIRST defined function in the
<span class="lineNum">      42 </span>            : // following list will be used (assuming T is defined in namespace
<span class="lineNum">      43 </span>            : // foo):
<span class="lineNum">      44 </span>            : //
<span class="lineNum">      45 </span>            : //   1. foo::PrintTo(const T&amp;, ostream*)
<span class="lineNum">      46 </span>            : //   2. operator&lt;&lt;(ostream&amp;, const T&amp;) defined in either foo or the
<span class="lineNum">      47 </span>            : //      global namespace.
<span class="lineNum">      48 </span>            : //
<span class="lineNum">      49 </span>            : // If none of the above is defined, it will print the debug string of
<span class="lineNum">      50 </span>            : // the value if it is a protocol buffer, or print the raw bytes in the
<span class="lineNum">      51 </span>            : // value otherwise.
<span class="lineNum">      52 </span>            : //
<span class="lineNum">      53 </span>            : // To aid debugging: when T is a reference type, the address of the
<span class="lineNum">      54 </span>            : // value is also printed; when T is a (const) char pointer, both the
<span class="lineNum">      55 </span>            : // pointer value and the NUL-terminated string it points to are
<span class="lineNum">      56 </span>            : // printed.
<span class="lineNum">      57 </span>            : //
<span class="lineNum">      58 </span>            : // We also provide some convenient wrappers:
<span class="lineNum">      59 </span>            : //
<span class="lineNum">      60 </span>            : //   // Prints a value to a string.  For a (const or not) char
<span class="lineNum">      61 </span>            : //   // pointer, the NUL-terminated string (but not the pointer) is
<span class="lineNum">      62 </span>            : //   // printed.
<span class="lineNum">      63 </span>            : //   std::string ::testing::PrintToString(const T&amp; value);
<span class="lineNum">      64 </span>            : //
<span class="lineNum">      65 </span>            : //   // Prints a value tersely: for a reference type, the referenced
<span class="lineNum">      66 </span>            : //   // value (but not the address) is printed; for a (const or not) char
<span class="lineNum">      67 </span>            : //   // pointer, the NUL-terminated string (but not the pointer) is
<span class="lineNum">      68 </span>            : //   // printed.
<span class="lineNum">      69 </span>            : //   void ::testing::internal::UniversalTersePrint(const T&amp; value, ostream*);
<span class="lineNum">      70 </span>            : //
<span class="lineNum">      71 </span>            : //   // Prints value using the type inferred by the compiler.  The difference
<span class="lineNum">      72 </span>            : //   // from UniversalTersePrint() is that this function prints both the
<span class="lineNum">      73 </span>            : //   // pointer and the NUL-terminated string for a (const or not) char pointer.
<span class="lineNum">      74 </span>            : //   void ::testing::internal::UniversalPrint(const T&amp; value, ostream*);
<span class="lineNum">      75 </span>            : //
<span class="lineNum">      76 </span>            : //   // Prints the fields of a tuple tersely to a string vector, one
<span class="lineNum">      77 </span>            : //   // element for each field. Tuple support must be enabled in
<span class="lineNum">      78 </span>            : //   // gtest-port.h.
<span class="lineNum">      79 </span>            : //   std::vector&lt;string&gt; UniversalTersePrintTupleFieldsToStrings(
<span class="lineNum">      80 </span>            : //       const Tuple&amp; value);
<span class="lineNum">      81 </span>            : //
<span class="lineNum">      82 </span>            : // Known limitation:
<span class="lineNum">      83 </span>            : //
<span class="lineNum">      84 </span>            : // The print primitives print the elements of an STL-style container
<span class="lineNum">      85 </span>            : // using the compiler-inferred type of *iter where iter is a
<span class="lineNum">      86 </span>            : // const_iterator of the container.  When const_iterator is an input
<span class="lineNum">      87 </span>            : // iterator but not a forward iterator, this inferred type may not
<span class="lineNum">      88 </span>            : // match value_type, and the print output may be incorrect.  In
<span class="lineNum">      89 </span>            : // practice, this is rarely a problem as for most containers
<span class="lineNum">      90 </span>            : // const_iterator is a forward iterator.  We'll fix this if there's an
<span class="lineNum">      91 </span>            : // actual need for it.  Note that this fix cannot rely on value_type
<span class="lineNum">      92 </span>            : // being defined as many user-defined container types don't have
<span class="lineNum">      93 </span>            : // value_type.
<span class="lineNum">      94 </span>            : 
<span class="lineNum">      95 </span>            : #ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
<span class="lineNum">      96 </span>            : #define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
<span class="lineNum">      97 </span>            : 
<span class="lineNum">      98 </span>            : #include &lt;ostream&gt;  // NOLINT
<span class="lineNum">      99 </span>            : #include &lt;sstream&gt;
<span class="lineNum">     100 </span>            : #include &lt;string&gt;
<span class="lineNum">     101 </span>            : #include &lt;utility&gt;
<span class="lineNum">     102 </span>            : #include &lt;vector&gt;
<span class="lineNum">     103 </span>            : #include &quot;gtest/internal/gtest-port.h&quot;
<span class="lineNum">     104 </span>            : #include &quot;gtest/internal/gtest-internal.h&quot;
<span class="lineNum">     105 </span>            : 
<span class="lineNum">     106 </span>            : namespace testing {
<span class="lineNum">     107 </span>            : 
<span class="lineNum">     108 </span>            : // Definitions in the 'internal' and 'internal2' name spaces are
<span class="lineNum">     109 </span>            : // subject to change without notice.  DO NOT USE THEM IN USER CODE!
<span class="lineNum">     110 </span>            : namespace internal2 {
<span class="lineNum">     111 </span>            : 
<span class="lineNum">     112 </span>            : // Prints the given number of bytes in the given object to the given
<span class="lineNum">     113 </span>            : // ostream.
<span class="lineNum">     114 </span>            : GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
<span class="lineNum">     115 </span>            :                                      size_t count,
<span class="lineNum">     116 </span>            :                                      ::std::ostream* os);
<span class="lineNum">     117 </span>            : 
<span class="lineNum">     118 </span>            : // For selecting which printer to use when a given type has neither &lt;&lt;
<span class="lineNum">     119 </span>            : // nor PrintTo().
<span class="lineNum">     120 </span>            : enum TypeKind {
<span class="lineNum">     121 </span>            :   kProtobuf,              // a protobuf type
<span class="lineNum">     122 </span>            :   kConvertibleToInteger,  // a type implicitly convertible to BiggestInt
<span class="lineNum">     123 </span>            :                           // (e.g. a named or unnamed enum type)
<span class="lineNum">     124 </span>            :   kOtherType              // anything else
<span class="lineNum">     125 </span>            : };
<span class="lineNum">     126 </span>            : 
<span class="lineNum">     127 </span>            : // TypeWithoutFormatter&lt;T, kTypeKind&gt;::PrintValue(value, os) is called
<span class="lineNum">     128 </span>            : // by the universal printer to print a value of type T when neither
<span class="lineNum">     129 </span>            : // operator&lt;&lt; nor PrintTo() is defined for T, where kTypeKind is the
<span class="lineNum">     130 </span>            : // &quot;kind&quot; of T as defined by enum TypeKind.
<span class="lineNum">     131 </span>            : template &lt;typename T, TypeKind kTypeKind&gt;
<span class="lineNum">     132 </span>            : class TypeWithoutFormatter {
<a name="133"><span class="lineNum">     133 </span>            :  public:</a>
<span class="lineNum">     134 </span>            :   // This default version is called when kTypeKind is kOtherType.
<span class="lineNum">     135 </span><span class="lineNoCov">          0 :   static void PrintValue(const T&amp; value, ::std::ostream* os) {</span>
<span class="lineNum">     136 </span><span class="lineNoCov">          0 :     PrintBytesInObjectTo(reinterpret_cast&lt;const unsigned char*&gt;(&amp;value),</span>
<span class="lineNum">     137 </span>            :                          sizeof(value), os);
<span class="lineNum">     138 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">     139 </span>            : };
<span class="lineNum">     140 </span>            : 
<span class="lineNum">     141 </span>            : // We print a protobuf using its ShortDebugString() when the string
<span class="lineNum">     142 </span>            : // doesn't exceed this many characters; otherwise we print it using
<span class="lineNum">     143 </span>            : // DebugString() for better readability.
<span class="lineNum">     144 </span>            : const size_t kProtobufOneLinerMaxLength = 50;
<span class="lineNum">     145 </span>            : 
<span class="lineNum">     146 </span>            : template &lt;typename T&gt;
<span class="lineNum">     147 </span>            : class TypeWithoutFormatter&lt;T, kProtobuf&gt; {
<span class="lineNum">     148 </span>            :  public:
<span class="lineNum">     149 </span>            :   static void PrintValue(const T&amp; value, ::std::ostream* os) {
<span class="lineNum">     150 </span>            :     const ::testing::internal::string short_str = value.ShortDebugString();
<span class="lineNum">     151 </span>            :     const ::testing::internal::string pretty_str =
<span class="lineNum">     152 </span>            :         short_str.length() &lt;= kProtobufOneLinerMaxLength ?
<span class="lineNum">     153 </span>            :         short_str : (&quot;\n&quot; + value.DebugString());
<span class="lineNum">     154 </span>            :     *os &lt;&lt; (&quot;&lt;&quot; + pretty_str + &quot;&gt;&quot;);
<span class="lineNum">     155 </span>            :   }
<span class="lineNum">     156 </span>            : };
<span class="lineNum">     157 </span>            : 
<span class="lineNum">     158 </span>            : template &lt;typename T&gt;
<span class="lineNum">     159 </span>            : class TypeWithoutFormatter&lt;T, kConvertibleToInteger&gt; {
<span class="lineNum">     160 </span>            :  public:
<span class="lineNum">     161 </span>            :   // Since T has no &lt;&lt; operator or PrintTo() but can be implicitly
<span class="lineNum">     162 </span>            :   // converted to BiggestInt, we print it as a BiggestInt.
<span class="lineNum">     163 </span>            :   //
<span class="lineNum">     164 </span>            :   // Most likely T is an enum type (either named or unnamed), in which
<span class="lineNum">     165 </span>            :   // case printing it as an integer is the desired behavior.  In case
<a name="166"><span class="lineNum">     166 </span>            :   // T is not an enum, printing it as an integer is the best we can do</a>
<span class="lineNum">     167 </span>            :   // given that it has no user-defined printer.
<span class="lineNum">     168 </span><span class="lineNoCov">          0 :   static void PrintValue(const T&amp; value, ::std::ostream* os) {</span>
<span class="lineNum">     169 </span><span class="lineNoCov">          0 :     const internal::BiggestInt kBigInt = value;</span>
<span class="lineNum">     170 </span><span class="lineNoCov">          0 :     *os &lt;&lt; kBigInt;</span>
<span class="lineNum">     171 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">     172 </span>            : };
<span class="lineNum">     173 </span>            : 
<span class="lineNum">     174 </span>            : // Prints the given value to the given ostream.  If the value is a
<span class="lineNum">     175 </span>            : // protocol message, its debug string is printed; if it's an enum or
<span class="lineNum">     176 </span>            : // of a type implicitly convertible to BiggestInt, it's printed as an
<span class="lineNum">     177 </span>            : // integer; otherwise the bytes in the value are printed.  This is
<span class="lineNum">     178 </span>            : // what UniversalPrinter&lt;T&gt;::Print() does when it knows nothing about
<span class="lineNum">     179 </span>            : // type T and T has neither &lt;&lt; operator nor PrintTo().
<span class="lineNum">     180 </span>            : //
<span class="lineNum">     181 </span>            : // A user can override this behavior for a class type Foo by defining
<span class="lineNum">     182 </span>            : // a &lt;&lt; operator in the namespace where Foo is defined.
<span class="lineNum">     183 </span>            : //
<span class="lineNum">     184 </span>            : // We put this operator in namespace 'internal2' instead of 'internal'
<span class="lineNum">     185 </span>            : // to simplify the implementation, as much code in 'internal' needs to
<span class="lineNum">     186 </span>            : // use &lt;&lt; in STL, which would conflict with our own &lt;&lt; were it defined
<span class="lineNum">     187 </span>            : // in 'internal'.
<span class="lineNum">     188 </span>            : //
<span class="lineNum">     189 </span>            : // Note that this operator&lt;&lt; takes a generic std::basic_ostream&lt;Char,
<span class="lineNum">     190 </span>            : // CharTraits&gt; type instead of the more restricted std::ostream.  If
<span class="lineNum">     191 </span>            : // we define it to take an std::ostream instead, we'll get an
<span class="lineNum">     192 </span>            : // &quot;ambiguous overloads&quot; compiler error when trying to print a type
<span class="lineNum">     193 </span>            : // Foo that supports streaming to std::basic_ostream&lt;Char,
<span class="lineNum">     194 </span>            : // CharTraits&gt;, as the compiler cannot tell whether
<span class="lineNum">     195 </span>            : // operator&lt;&lt;(std::ostream&amp;, const T&amp;) or
<span class="lineNum">     196 </span>            : // operator&lt;&lt;(std::basic_stream&lt;Char, CharTraits&gt;, const Foo&amp;) is more
<a name="197"><span class="lineNum">     197 </span>            : // specific.</a>
<span class="lineNum">     198 </span>            : template &lt;typename Char, typename CharTraits, typename T&gt;
<span class="lineNum">     199 </span><span class="lineNoCov">          0 : ::std::basic_ostream&lt;Char, CharTraits&gt;&amp; operator&lt;&lt;(</span>
<span class="lineNum">     200 </span>            :     ::std::basic_ostream&lt;Char, CharTraits&gt;&amp; os, const T&amp; x) {
<span class="lineNum">     201 </span><span class="lineNoCov">          0 :   TypeWithoutFormatter&lt;T,</span>
<span class="lineNum">     202 </span>            :       (internal::IsAProtocolMessage&lt;T&gt;::value ? kProtobuf :
<span class="lineNum">     203 </span>            :        internal::ImplicitlyConvertible&lt;const T&amp;, internal::BiggestInt&gt;::value ?
<span class="lineNum">     204 </span>            :        kConvertibleToInteger : kOtherType)&gt;::PrintValue(x, &amp;os);
<span class="lineNum">     205 </span><span class="lineNoCov">          0 :   return os;</span>
<span class="lineNum">     206 </span>            : }
<span class="lineNum">     207 </span>            : 
<span class="lineNum">     208 </span>            : }  // namespace internal2
<span class="lineNum">     209 </span>            : }  // namespace testing
<span class="lineNum">     210 </span>            : 
<span class="lineNum">     211 </span>            : // This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
<span class="lineNum">     212 </span>            : // magic needed for implementing UniversalPrinter won't work.
<span class="lineNum">     213 </span>            : namespace testing_internal {
<span class="lineNum">     214 </span>            : 
<span class="lineNum">     215 </span>            : // Used to print a value that is not an STL-style container when the
<a name="216"><span class="lineNum">     216 </span>            : // user doesn't define PrintTo() for it.</a>
<span class="lineNum">     217 </span>            : template &lt;typename T&gt;
<span class="lineNum">     218 </span><span class="lineNoCov">          0 : void DefaultPrintNonContainerTo(const T&amp; value, ::std::ostream* os) {</span>
<span class="lineNum">     219 </span>            :   // With the following statement, during unqualified name lookup,
<span class="lineNum">     220 </span>            :   // testing::internal2::operator&lt;&lt; appears as if it was declared in
<span class="lineNum">     221 </span>            :   // the nearest enclosing namespace that contains both
<span class="lineNum">     222 </span>            :   // ::testing_internal and ::testing::internal2, i.e. the global
<span class="lineNum">     223 </span>            :   // namespace.  For more details, refer to the C++ Standard section
<span class="lineNum">     224 </span>            :   // 7.3.4-1 [namespace.udir].  This allows us to fall back onto
<span class="lineNum">     225 </span>            :   // testing::internal2::operator&lt;&lt; in case T doesn't come with a &lt;&lt;
<span class="lineNum">     226 </span>            :   // operator.
<span class="lineNum">     227 </span>            :   //
<span class="lineNum">     228 </span>            :   // We cannot write 'using ::testing::internal2::operator&lt;&lt;;', which
<span class="lineNum">     229 </span>            :   // gcc 3.3 fails to compile due to a compiler bug.
<span class="lineNum">     230 </span>            :   using namespace ::testing::internal2;  // NOLINT
<span class="lineNum">     231 </span>            : 
<span class="lineNum">     232 </span>            :   // Assuming T is defined in namespace foo, in the next statement,
<span class="lineNum">     233 </span>            :   // the compiler will consider all of:
<span class="lineNum">     234 </span>            :   //
<span class="lineNum">     235 </span>            :   //   1. foo::operator&lt;&lt; (thanks to Koenig look-up),
<span class="lineNum">     236 </span>            :   //   2. ::operator&lt;&lt; (as the current namespace is enclosed in ::),
<span class="lineNum">     237 </span>            :   //   3. testing::internal2::operator&lt;&lt; (thanks to the using statement above).
<span class="lineNum">     238 </span>            :   //
<span class="lineNum">     239 </span>            :   // The operator&lt;&lt; whose type matches T best will be picked.
<span class="lineNum">     240 </span>            :   //
<span class="lineNum">     241 </span>            :   // We deliberately allow #2 to be a candidate, as sometimes it's
<span class="lineNum">     242 </span>            :   // impossible to define #1 (e.g. when foo is ::std, defining
<span class="lineNum">     243 </span>            :   // anything in it is undefined behavior unless you are a compiler
<span class="lineNum">     244 </span>            :   // vendor.).
<span class="lineNum">     245 </span><span class="lineNoCov">          0 :   *os &lt;&lt; value;</span>
<span class="lineNum">     246 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     247 </span>            : 
<span class="lineNum">     248 </span>            : }  // namespace testing_internal
<span class="lineNum">     249 </span>            : 
<span class="lineNum">     250 </span>            : namespace testing {
<span class="lineNum">     251 </span>            : namespace internal {
<span class="lineNum">     252 </span>            : 
<span class="lineNum">     253 </span>            : // UniversalPrinter&lt;T&gt;::Print(value, ostream_ptr) prints the given
<span class="lineNum">     254 </span>            : // value to the given ostream.  The caller must ensure that
<span class="lineNum">     255 </span>            : // 'ostream_ptr' is not NULL, or the behavior is undefined.
<span class="lineNum">     256 </span>            : //
<span class="lineNum">     257 </span>            : // We define UniversalPrinter as a class template (as opposed to a
<span class="lineNum">     258 </span>            : // function template), as we need to partially specialize it for
<span class="lineNum">     259 </span>            : // reference types, which cannot be done with function templates.
<span class="lineNum">     260 </span>            : template &lt;typename T&gt;
<span class="lineNum">     261 </span>            : class UniversalPrinter;
<span class="lineNum">     262 </span>            : 
<span class="lineNum">     263 </span>            : template &lt;typename T&gt;
<span class="lineNum">     264 </span>            : void UniversalPrint(const T&amp; value, ::std::ostream* os);
<span class="lineNum">     265 </span>            : 
<span class="lineNum">     266 </span>            : // Used to print an STL-style container when the user doesn't define
<a name="267"><span class="lineNum">     267 </span>            : // a PrintTo() for it.</a>
<span class="lineNum">     268 </span>            : template &lt;typename C&gt;
<span class="lineNum">     269 </span><span class="lineNoCov">          0 : void DefaultPrintTo(IsContainer /* dummy */,</span>
<span class="lineNum">     270 </span>            :                     false_type /* is not a pointer */,
<span class="lineNum">     271 </span>            :                     const C&amp; container, ::std::ostream* os) {
<span class="lineNum">     272 </span><span class="lineNoCov">          0 :   const size_t kMaxCount = 32;  // The maximum number of elements to print.</span>
<span class="lineNum">     273 </span><span class="lineNoCov">          0 :   *os &lt;&lt; '{';</span>
<span class="lineNum">     274 </span><span class="lineNoCov">          0 :   size_t count = 0;</span>
<span class="lineNum">     275 </span><span class="lineNoCov">          0 :   for (typename C::const_iterator it = container.begin();</span>
<span class="lineNum">     276 </span><span class="lineNoCov">          0 :        it != container.end(); ++it, ++count) {</span>
<span class="lineNum">     277 </span><span class="lineNoCov">          0 :     if (count &gt; 0) {</span>
<span class="lineNum">     278 </span><span class="lineNoCov">          0 :       *os &lt;&lt; ',';</span>
<span class="lineNum">     279 </span><span class="lineNoCov">          0 :       if (count == kMaxCount) {  // Enough has been printed.</span>
<span class="lineNum">     280 </span><span class="lineNoCov">          0 :         *os &lt;&lt; &quot; ...&quot;;</span>
<span class="lineNum">     281 </span><span class="lineNoCov">          0 :         break;</span>
<span class="lineNum">     282 </span>            :       }
<span class="lineNum">     283 </span>            :     }
<span class="lineNum">     284 </span><span class="lineNoCov">          0 :     *os &lt;&lt; ' ';</span>
<span class="lineNum">     285 </span>            :     // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
<span class="lineNum">     286 </span>            :     // handle *it being a native array.
<span class="lineNum">     287 </span><span class="lineNoCov">          0 :     internal::UniversalPrint(*it, os);</span>
<span class="lineNum">     288 </span>            :   }
<span class="lineNum">     289 </span>            : 
<span class="lineNum">     290 </span><span class="lineNoCov">          0 :   if (count &gt; 0) {</span>
<span class="lineNum">     291 </span><span class="lineNoCov">          0 :     *os &lt;&lt; ' ';</span>
<span class="lineNum">     292 </span>            :   }
<span class="lineNum">     293 </span><span class="lineNoCov">          0 :   *os &lt;&lt; '}';</span>
<span class="lineNum">     294 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     295 </span>            : 
<span class="lineNum">     296 </span>            : // Used to print a pointer that is neither a char pointer nor a member
<span class="lineNum">     297 </span>            : // pointer, when the user doesn't define PrintTo() for it.  (A member
<span class="lineNum">     298 </span>            : // variable pointer or member function pointer doesn't really point to
<span class="lineNum">     299 </span>            : // a location in the address space.  Their representation is
<span class="lineNum">     300 </span>            : // implementation-defined.  Therefore they will be printed as raw
<span class="lineNum">     301 </span>            : // bytes.)
<span class="lineNum">     302 </span>            : template &lt;typename T&gt;
<span class="lineNum">     303 </span>            : void DefaultPrintTo(IsNotContainer /* dummy */,
<span class="lineNum">     304 </span>            :                     true_type /* is a pointer */,
<span class="lineNum">     305 </span>            :                     T* p, ::std::ostream* os) {
<span class="lineNum">     306 </span>            :   if (p == NULL) {
<span class="lineNum">     307 </span>            :     *os &lt;&lt; &quot;NULL&quot;;
<span class="lineNum">     308 </span>            :   } else {
<span class="lineNum">     309 </span>            :     // C++ doesn't allow casting from a function pointer to any object
<span class="lineNum">     310 </span>            :     // pointer.
<span class="lineNum">     311 </span>            :     //
<span class="lineNum">     312 </span>            :     // IsTrue() silences warnings: &quot;Condition is always true&quot;,
<span class="lineNum">     313 </span>            :     // &quot;unreachable code&quot;.
<span class="lineNum">     314 </span>            :     if (IsTrue(ImplicitlyConvertible&lt;T*, const void*&gt;::value)) {
<span class="lineNum">     315 </span>            :       // T is not a function type.  We just call &lt;&lt; to print p,
<span class="lineNum">     316 </span>            :       // relying on ADL to pick up user-defined &lt;&lt; for their pointer
<span class="lineNum">     317 </span>            :       // types, if any.
<span class="lineNum">     318 </span>            :       *os &lt;&lt; p;
<span class="lineNum">     319 </span>            :     } else {
<span class="lineNum">     320 </span>            :       // T is a function type, so '*os &lt;&lt; p' doesn't do what we want
<span class="lineNum">     321 </span>            :       // (it just prints p as bool).  We want to print p as a const
<span class="lineNum">     322 </span>            :       // void*.  However, we cannot cast it to const void* directly,
<span class="lineNum">     323 </span>            :       // even using reinterpret_cast, as earlier versions of gcc
<span class="lineNum">     324 </span>            :       // (e.g. 3.4.5) cannot compile the cast when p is a function
<span class="lineNum">     325 </span>            :       // pointer.  Casting to UInt64 first solves the problem.
<span class="lineNum">     326 </span>            :       *os &lt;&lt; reinterpret_cast&lt;const void*&gt;(
<span class="lineNum">     327 </span>            :           reinterpret_cast&lt;internal::UInt64&gt;(p));
<span class="lineNum">     328 </span>            :     }
<span class="lineNum">     329 </span>            :   }
<span class="lineNum">     330 </span>            : }
<span class="lineNum">     331 </span>            : 
<span class="lineNum">     332 </span>            : // Used to print a non-container, non-pointer value when the user
<a name="333"><span class="lineNum">     333 </span>            : // doesn't define PrintTo() for it.</a>
<span class="lineNum">     334 </span>            : template &lt;typename T&gt;
<span class="lineNum">     335 </span><span class="lineNoCov">          0 : void DefaultPrintTo(IsNotContainer /* dummy */,</span>
<span class="lineNum">     336 </span>            :                     false_type /* is not a pointer */,
<span class="lineNum">     337 </span>            :                     const T&amp; value, ::std::ostream* os) {
<span class="lineNum">     338 </span><span class="lineNoCov">          0 :   ::testing_internal::DefaultPrintNonContainerTo(value, os);</span>
<span class="lineNum">     339 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     340 </span>            : 
<span class="lineNum">     341 </span>            : // Prints the given value using the &lt;&lt; operator if it has one;
<span class="lineNum">     342 </span>            : // otherwise prints the bytes in it.  This is what
<span class="lineNum">     343 </span>            : // UniversalPrinter&lt;T&gt;::Print() does when PrintTo() is not specialized
<span class="lineNum">     344 </span>            : // or overloaded for type T.
<span class="lineNum">     345 </span>            : //
<span class="lineNum">     346 </span>            : // A user can override this behavior for a class type Foo by defining
<span class="lineNum">     347 </span>            : // an overload of PrintTo() in the namespace where Foo is defined.  We
<span class="lineNum">     348 </span>            : // give the user this option as sometimes defining a &lt;&lt; operator for
<span class="lineNum">     349 </span>            : // Foo is not desirable (e.g. the coding style may prevent doing it,
<span class="lineNum">     350 </span>            : // or there is already a &lt;&lt; operator but it doesn't do what the user
<a name="351"><span class="lineNum">     351 </span>            : // wants).</a>
<span class="lineNum">     352 </span>            : template &lt;typename T&gt;
<span class="lineNum">     353 </span><span class="lineNoCov">          0 : void PrintTo(const T&amp; value, ::std::ostream* os) {</span>
<span class="lineNum">     354 </span>            :   // DefaultPrintTo() is overloaded.  The type of its first two
<span class="lineNum">     355 </span>            :   // arguments determine which version will be picked.  If T is an
<span class="lineNum">     356 </span>            :   // STL-style container, the version for container will be called; if
<span class="lineNum">     357 </span>            :   // T is a pointer, the pointer version will be called; otherwise the
<span class="lineNum">     358 </span>            :   // generic version will be called.
<span class="lineNum">     359 </span>            :   //
<span class="lineNum">     360 </span>            :   // Note that we check for container types here, prior to we check
<span class="lineNum">     361 </span>            :   // for protocol message types in our operator&lt;&lt;.  The rationale is:
<span class="lineNum">     362 </span>            :   //
<span class="lineNum">     363 </span>            :   // For protocol messages, we want to give people a chance to
<span class="lineNum">     364 </span>            :   // override Google Mock's format by defining a PrintTo() or
<span class="lineNum">     365 </span>            :   // operator&lt;&lt;.  For STL containers, other formats can be
<span class="lineNum">     366 </span>            :   // incompatible with Google Mock's format for the container
<span class="lineNum">     367 </span>            :   // elements; therefore we check for container types here to ensure
<span class="lineNum">     368 </span>            :   // that our format is used.
<span class="lineNum">     369 </span>            :   //
<span class="lineNum">     370 </span>            :   // The second argument of DefaultPrintTo() is needed to bypass a bug
<span class="lineNum">     371 </span>            :   // in Symbian's C++ compiler that prevents it from picking the right
<span class="lineNum">     372 </span>            :   // overload between:
<span class="lineNum">     373 </span>            :   //
<span class="lineNum">     374 </span>            :   //   PrintTo(const T&amp; x, ...);
<span class="lineNum">     375 </span>            :   //   PrintTo(T* x, ...);
<span class="lineNum">     376 </span><span class="lineNoCov">          0 :   DefaultPrintTo(IsContainerTest&lt;T&gt;(0), is_pointer&lt;T&gt;(), value, os);</span>
<span class="lineNum">     377 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     378 </span>            : 
<span class="lineNum">     379 </span>            : // The following list of PrintTo() overloads tells
<span class="lineNum">     380 </span>            : // UniversalPrinter&lt;T&gt;::Print() how to print standard types (built-in
<span class="lineNum">     381 </span>            : // types, strings, plain arrays, and pointers).
<span class="lineNum">     382 </span>            : 
<span class="lineNum">     383 </span>            : // Overloads for various char types.
<a name="384"><span class="lineNum">     384 </span>            : GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);</a>
<span class="lineNum">     385 </span>            : GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
<span class="lineNum">     386 </span><span class="lineNoCov">          0 : inline void PrintTo(char c, ::std::ostream* os) {</span>
<span class="lineNum">     387 </span>            :   // When printing a plain char, we always treat it as unsigned.  This
<span class="lineNum">     388 </span>            :   // way, the output won't be affected by whether the compiler thinks
<span class="lineNum">     389 </span>            :   // char is signed or not.
<span class="lineNum">     390 </span><span class="lineNoCov">          0 :   PrintTo(static_cast&lt;unsigned char&gt;(c), os);</span>
<span class="lineNum">     391 </span><span class="lineNoCov">          0 : }</span>
<a name="392"><span class="lineNum">     392 </span>            : </a>
<span class="lineNum">     393 </span>            : // Overloads for other simple built-in types.
<span class="lineNum">     394 </span><span class="lineNoCov">          0 : inline void PrintTo(bool x, ::std::ostream* os) {</span>
<span class="lineNum">     395 </span><span class="lineNoCov">          0 :   *os &lt;&lt; (x ? &quot;true&quot; : &quot;false&quot;);</span>
<span class="lineNum">     396 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     397 </span>            : 
<span class="lineNum">     398 </span>            : // Overload for wchar_t type.
<span class="lineNum">     399 </span>            : // Prints a wchar_t as a symbol if it is printable or as its internal
<span class="lineNum">     400 </span>            : // code otherwise and also as its decimal code (except for L'\0').
<span class="lineNum">     401 </span>            : // The L'\0' char is printed as &quot;L'\\0'&quot;. The decimal code is printed
<span class="lineNum">     402 </span>            : // as signed integer when wchar_t is implemented by the compiler
<span class="lineNum">     403 </span>            : // as a signed type and is printed as an unsigned integer when wchar_t
<span class="lineNum">     404 </span>            : // is implemented as an unsigned type.
<span class="lineNum">     405 </span>            : GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
<span class="lineNum">     406 </span>            : 
<span class="lineNum">     407 </span>            : // Overloads for C strings.
<span class="lineNum">     408 </span>            : GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
<span class="lineNum">     409 </span>            : inline void PrintTo(char* s, ::std::ostream* os) {
<span class="lineNum">     410 </span>            :   PrintTo(ImplicitCast_&lt;const char*&gt;(s), os);
<span class="lineNum">     411 </span>            : }
<span class="lineNum">     412 </span>            : 
<span class="lineNum">     413 </span>            : // signed/unsigned char is often used for representing binary data, so
<span class="lineNum">     414 </span>            : // we print pointers to it as void* to be safe.
<span class="lineNum">     415 </span>            : inline void PrintTo(const signed char* s, ::std::ostream* os) {
<span class="lineNum">     416 </span>            :   PrintTo(ImplicitCast_&lt;const void*&gt;(s), os);
<span class="lineNum">     417 </span>            : }
<span class="lineNum">     418 </span>            : inline void PrintTo(signed char* s, ::std::ostream* os) {
<span class="lineNum">     419 </span>            :   PrintTo(ImplicitCast_&lt;const void*&gt;(s), os);
<span class="lineNum">     420 </span>            : }
<span class="lineNum">     421 </span>            : inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
<span class="lineNum">     422 </span>            :   PrintTo(ImplicitCast_&lt;const void*&gt;(s), os);
<span class="lineNum">     423 </span>            : }
<span class="lineNum">     424 </span>            : inline void PrintTo(unsigned char* s, ::std::ostream* os) {
<span class="lineNum">     425 </span>            :   PrintTo(ImplicitCast_&lt;const void*&gt;(s), os);
<span class="lineNum">     426 </span>            : }
<span class="lineNum">     427 </span>            : 
<span class="lineNum">     428 </span>            : // MSVC can be configured to define wchar_t as a typedef of unsigned
<span class="lineNum">     429 </span>            : // short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
<span class="lineNum">     430 </span>            : // type.  When wchar_t is a typedef, defining an overload for const
<span class="lineNum">     431 </span>            : // wchar_t* would cause unsigned short* be printed as a wide string,
<span class="lineNum">     432 </span>            : // possibly causing invalid memory accesses.
<span class="lineNum">     433 </span>            : #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
<span class="lineNum">     434 </span>            : // Overloads for wide C strings
<span class="lineNum">     435 </span>            : GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
<span class="lineNum">     436 </span>            : inline void PrintTo(wchar_t* s, ::std::ostream* os) {
<span class="lineNum">     437 </span>            :   PrintTo(ImplicitCast_&lt;const wchar_t*&gt;(s), os);
<span class="lineNum">     438 </span>            : }
<span class="lineNum">     439 </span>            : #endif
<span class="lineNum">     440 </span>            : 
<span class="lineNum">     441 </span>            : // Overload for C arrays.  Multi-dimensional arrays are printed
<span class="lineNum">     442 </span>            : // properly.
<span class="lineNum">     443 </span>            : 
<span class="lineNum">     444 </span>            : // Prints the given number of elements in an array, without printing
<span class="lineNum">     445 </span>            : // the curly braces.
<span class="lineNum">     446 </span>            : template &lt;typename T&gt;
<span class="lineNum">     447 </span>            : void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
<span class="lineNum">     448 </span>            :   UniversalPrint(a[0], os);
<span class="lineNum">     449 </span>            :   for (size_t i = 1; i != count; i++) {
<span class="lineNum">     450 </span>            :     *os &lt;&lt; &quot;, &quot;;
<span class="lineNum">     451 </span>            :     UniversalPrint(a[i], os);
<span class="lineNum">     452 </span>            :   }
<span class="lineNum">     453 </span>            : }
<span class="lineNum">     454 </span>            : 
<span class="lineNum">     455 </span>            : // Overloads for ::string and ::std::string.
<span class="lineNum">     456 </span>            : #if GTEST_HAS_GLOBAL_STRING
<span class="lineNum">     457 </span>            : GTEST_API_ void PrintStringTo(const ::string&amp;s, ::std::ostream* os);
<span class="lineNum">     458 </span>            : inline void PrintTo(const ::string&amp; s, ::std::ostream* os) {
<span class="lineNum">     459 </span>            :   PrintStringTo(s, os);
<span class="lineNum">     460 </span>            : }
<span class="lineNum">     461 </span>            : #endif  // GTEST_HAS_GLOBAL_STRING
<a name="462"><span class="lineNum">     462 </span>            : </a>
<span class="lineNum">     463 </span>            : GTEST_API_ void PrintStringTo(const ::std::string&amp;s, ::std::ostream* os);
<span class="lineNum">     464 </span><span class="lineNoCov">          0 : inline void PrintTo(const ::std::string&amp; s, ::std::ostream* os) {</span>
<span class="lineNum">     465 </span><span class="lineNoCov">          0 :   PrintStringTo(s, os);</span>
<span class="lineNum">     466 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     467 </span>            : 
<span class="lineNum">     468 </span>            : // Overloads for ::wstring and ::std::wstring.
<span class="lineNum">     469 </span>            : #if GTEST_HAS_GLOBAL_WSTRING
<span class="lineNum">     470 </span>            : GTEST_API_ void PrintWideStringTo(const ::wstring&amp;s, ::std::ostream* os);
<span class="lineNum">     471 </span>            : inline void PrintTo(const ::wstring&amp; s, ::std::ostream* os) {
<span class="lineNum">     472 </span>            :   PrintWideStringTo(s, os);
<span class="lineNum">     473 </span>            : }
<span class="lineNum">     474 </span>            : #endif  // GTEST_HAS_GLOBAL_WSTRING
<span class="lineNum">     475 </span>            : 
<a name="476"><span class="lineNum">     476 </span>            : #if GTEST_HAS_STD_WSTRING</a>
<span class="lineNum">     477 </span>            : GTEST_API_ void PrintWideStringTo(const ::std::wstring&amp;s, ::std::ostream* os);
<span class="lineNum">     478 </span><span class="lineNoCov">          0 : inline void PrintTo(const ::std::wstring&amp; s, ::std::ostream* os) {</span>
<span class="lineNum">     479 </span><span class="lineNoCov">          0 :   PrintWideStringTo(s, os);</span>
<span class="lineNum">     480 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     481 </span>            : #endif  // GTEST_HAS_STD_WSTRING
<span class="lineNum">     482 </span>            : 
<span class="lineNum">     483 </span>            : #if GTEST_HAS_TR1_TUPLE
<span class="lineNum">     484 </span>            : // Overload for ::std::tr1::tuple.  Needed for printing function arguments,
<span class="lineNum">     485 </span>            : // which are packed as tuples.
<span class="lineNum">     486 </span>            : 
<span class="lineNum">     487 </span>            : // Helper function for printing a tuple.  T must be instantiated with
<span class="lineNum">     488 </span>            : // a tuple type.
<span class="lineNum">     489 </span>            : template &lt;typename T&gt;
<span class="lineNum">     490 </span>            : void PrintTupleTo(const T&amp; t, ::std::ostream* os);
<span class="lineNum">     491 </span>            : 
<span class="lineNum">     492 </span>            : // Overloaded PrintTo() for tuples of various arities.  We support
<span class="lineNum">     493 </span>            : // tuples of up-to 10 fields.  The following implementation works
<span class="lineNum">     494 </span>            : // regardless of whether tr1::tuple is implemented using the
<a name="495"><span class="lineNum">     495 </span>            : // non-standard variadic template feature or not.</a>
<span class="lineNum">     496 </span>            : 
<span class="lineNum">     497 </span><span class="lineNoCov">          0 : inline void PrintTo(const ::std::tr1::tuple&lt;&gt;&amp; t, ::std::ostream* os) {</span>
<span class="lineNum">     498 </span><span class="lineNoCov">          0 :   PrintTupleTo(t, os);</span>
<span class="lineNum">     499 </span><span class="lineNoCov">          0 : }</span>
<a name="500"><span class="lineNum">     500 </span>            : </a>
<span class="lineNum">     501 </span>            : template &lt;typename T1&gt;
<span class="lineNum">     502 </span><span class="lineNoCov">          0 : void PrintTo(const ::std::tr1::tuple&lt;T1&gt;&amp; t, ::std::ostream* os) {</span>
<span class="lineNum">     503 </span><span class="lineNoCov">          0 :   PrintTupleTo(t, os);</span>
<span class="lineNum">     504 </span><span class="lineNoCov">          0 : }</span>
<a name="505"><span class="lineNum">     505 </span>            : </a>
<span class="lineNum">     506 </span>            : template &lt;typename T1, typename T2&gt;
<span class="lineNum">     507 </span><span class="lineNoCov">          0 : void PrintTo(const ::std::tr1::tuple&lt;T1, T2&gt;&amp; t, ::std::ostream* os) {</span>
<span class="lineNum">     508 </span><span class="lineNoCov">          0 :   PrintTupleTo(t, os);</span>
<span class="lineNum">     509 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     510 </span>            : 
<span class="lineNum">     511 </span>            : template &lt;typename T1, typename T2, typename T3&gt;
<span class="lineNum">     512 </span>            : void PrintTo(const ::std::tr1::tuple&lt;T1, T2, T3&gt;&amp; t, ::std::ostream* os) {
<span class="lineNum">     513 </span>            :   PrintTupleTo(t, os);
<span class="lineNum">     514 </span>            : }
<a name="515"><span class="lineNum">     515 </span>            : </a>
<span class="lineNum">     516 </span>            : template &lt;typename T1, typename T2, typename T3, typename T4&gt;
<span class="lineNum">     517 </span><span class="lineNoCov">          0 : void PrintTo(const ::std::tr1::tuple&lt;T1, T2, T3, T4&gt;&amp; t, ::std::ostream* os) {</span>
<span class="lineNum">     518 </span><span class="lineNoCov">          0 :   PrintTupleTo(t, os);</span>
<span class="lineNum">     519 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     520 </span>            : 
<span class="lineNum">     521 </span>            : template &lt;typename T1, typename T2, typename T3, typename T4, typename T5&gt;
<span class="lineNum">     522 </span>            : void PrintTo(const ::std::tr1::tuple&lt;T1, T2, T3, T4, T5&gt;&amp; t,
<span class="lineNum">     523 </span>            :              ::std::ostream* os) {
<span class="lineNum">     524 </span>            :   PrintTupleTo(t, os);
<span class="lineNum">     525 </span>            : }
<span class="lineNum">     526 </span>            : 
<span class="lineNum">     527 </span>            : template &lt;typename T1, typename T2, typename T3, typename T4, typename T5,
<span class="lineNum">     528 </span>            :           typename T6&gt;
<span class="lineNum">     529 </span>            : void PrintTo(const ::std::tr1::tuple&lt;T1, T2, T3, T4, T5, T6&gt;&amp; t,
<span class="lineNum">     530 </span>            :              ::std::ostream* os) {
<span class="lineNum">     531 </span>            :   PrintTupleTo(t, os);
<span class="lineNum">     532 </span>            : }
<span class="lineNum">     533 </span>            : 
<span class="lineNum">     534 </span>            : template &lt;typename T1, typename T2, typename T3, typename T4, typename T5,
<span class="lineNum">     535 </span>            :           typename T6, typename T7&gt;
<span class="lineNum">     536 </span>            : void PrintTo(const ::std::tr1::tuple&lt;T1, T2, T3, T4, T5, T6, T7&gt;&amp; t,
<span class="lineNum">     537 </span>            :              ::std::ostream* os) {
<span class="lineNum">     538 </span>            :   PrintTupleTo(t, os);
<span class="lineNum">     539 </span>            : }
<span class="lineNum">     540 </span>            : 
<span class="lineNum">     541 </span>            : template &lt;typename T1, typename T2, typename T3, typename T4, typename T5,
<span class="lineNum">     542 </span>            :           typename T6, typename T7, typename T8&gt;
<span class="lineNum">     543 </span>            : void PrintTo(const ::std::tr1::tuple&lt;T1, T2, T3, T4, T5, T6, T7, T8&gt;&amp; t,
<span class="lineNum">     544 </span>            :              ::std::ostream* os) {
<span class="lineNum">     545 </span>            :   PrintTupleTo(t, os);
<span class="lineNum">     546 </span>            : }
<span class="lineNum">     547 </span>            : 
<span class="lineNum">     548 </span>            : template &lt;typename T1, typename T2, typename T3, typename T4, typename T5,
<span class="lineNum">     549 </span>            :           typename T6, typename T7, typename T8, typename T9&gt;
<span class="lineNum">     550 </span>            : void PrintTo(const ::std::tr1::tuple&lt;T1, T2, T3, T4, T5, T6, T7, T8, T9&gt;&amp; t,
<span class="lineNum">     551 </span>            :              ::std::ostream* os) {
<span class="lineNum">     552 </span>            :   PrintTupleTo(t, os);
<span class="lineNum">     553 </span>            : }
<span class="lineNum">     554 </span>            : 
<span class="lineNum">     555 </span>            : template &lt;typename T1, typename T2, typename T3, typename T4, typename T5,
<span class="lineNum">     556 </span>            :           typename T6, typename T7, typename T8, typename T9, typename T10&gt;
<span class="lineNum">     557 </span>            : void PrintTo(
<span class="lineNum">     558 </span>            :     const ::std::tr1::tuple&lt;T1, T2, T3, T4, T5, T6, T7, T8, T9, T10&gt;&amp; t,
<span class="lineNum">     559 </span>            :     ::std::ostream* os) {
<span class="lineNum">     560 </span>            :   PrintTupleTo(t, os);
<span class="lineNum">     561 </span>            : }
<span class="lineNum">     562 </span>            : #endif  // GTEST_HAS_TR1_TUPLE
<span class="lineNum">     563 </span>            : 
<a name="564"><span class="lineNum">     564 </span>            : // Overload for std::pair.</a>
<span class="lineNum">     565 </span>            : template &lt;typename T1, typename T2&gt;
<span class="lineNum">     566 </span><span class="lineNoCov">          0 : void PrintTo(const ::std::pair&lt;T1, T2&gt;&amp; value, ::std::ostream* os) {</span>
<span class="lineNum">     567 </span><span class="lineNoCov">          0 :   *os &lt;&lt; '(';</span>
<span class="lineNum">     568 </span>            :   // We cannot use UniversalPrint(value.first, os) here, as T1 may be
<span class="lineNum">     569 </span>            :   // a reference type.  The same for printing value.second.
<span class="lineNum">     570 </span><span class="lineNoCov">          0 :   UniversalPrinter&lt;T1&gt;::Print(value.first, os);</span>
<span class="lineNum">     571 </span><span class="lineNoCov">          0 :   *os &lt;&lt; &quot;, &quot;;</span>
<span class="lineNum">     572 </span><span class="lineNoCov">          0 :   UniversalPrinter&lt;T2&gt;::Print(value.second, os);</span>
<span class="lineNum">     573 </span><span class="lineNoCov">          0 :   *os &lt;&lt; ')';</span>
<span class="lineNum">     574 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     575 </span>            : 
<span class="lineNum">     576 </span>            : // Implements printing a non-reference type T by letting the compiler
<span class="lineNum">     577 </span>            : // pick the right overload of PrintTo() for T.
<span class="lineNum">     578 </span>            : template &lt;typename T&gt;
<span class="lineNum">     579 </span>            : class UniversalPrinter {
<span class="lineNum">     580 </span>            :  public:
<span class="lineNum">     581 </span>            :   // MSVC warns about adding const to a function type, so we want to
<span class="lineNum">     582 </span>            :   // disable the warning.
<span class="lineNum">     583 </span>            : #ifdef _MSC_VER
<span class="lineNum">     584 </span>            : # pragma warning(push)          // Saves the current warning state.
<span class="lineNum">     585 </span>            : # pragma warning(disable:4180)  // Temporarily disables warning 4180.
<span class="lineNum">     586 </span>            : #endif  // _MSC_VER
<span class="lineNum">     587 </span>            : 
<span class="lineNum">     588 </span>            :   // Note: we deliberately don't call this PrintTo(), as that name
<a name="589"><span class="lineNum">     589 </span>            :   // conflicts with ::testing::internal::PrintTo in the body of the</a>
<span class="lineNum">     590 </span>            :   // function.
<span class="lineNum">     591 </span><span class="lineNoCov">          0 :   static void Print(const T&amp; value, ::std::ostream* os) {</span>
<span class="lineNum">     592 </span>            :     // By default, ::testing::internal::PrintTo() is used for printing
<span class="lineNum">     593 </span>            :     // the value.
<span class="lineNum">     594 </span>            :     //
<span class="lineNum">     595 </span>            :     // Thanks to Koenig look-up, if T is a class and has its own
<span class="lineNum">     596 </span>            :     // PrintTo() function defined in its namespace, that function will
<span class="lineNum">     597 </span>            :     // be visible here.  Since it is more specific than the generic ones
<span class="lineNum">     598 </span>            :     // in ::testing::internal, it will be picked by the compiler in the
<span class="lineNum">     599 </span>            :     // following statement - exactly what we want.
<span class="lineNum">     600 </span><span class="lineNoCov">          0 :     PrintTo(value, os);</span>
<span class="lineNum">     601 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">     602 </span>            : 
<span class="lineNum">     603 </span>            : #ifdef _MSC_VER
<span class="lineNum">     604 </span>            : # pragma warning(pop)           // Restores the warning state.
<span class="lineNum">     605 </span>            : #endif  // _MSC_VER
<span class="lineNum">     606 </span>            : };
<span class="lineNum">     607 </span>            : 
<span class="lineNum">     608 </span>            : // UniversalPrintArray(begin, len, os) prints an array of 'len'
<span class="lineNum">     609 </span>            : // elements, starting at address 'begin'.
<span class="lineNum">     610 </span>            : template &lt;typename T&gt;
<span class="lineNum">     611 </span>            : void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
<span class="lineNum">     612 </span>            :   if (len == 0) {
<span class="lineNum">     613 </span>            :     *os &lt;&lt; &quot;{}&quot;;
<span class="lineNum">     614 </span>            :   } else {
<span class="lineNum">     615 </span>            :     *os &lt;&lt; &quot;{ &quot;;
<span class="lineNum">     616 </span>            :     const size_t kThreshold = 18;
<span class="lineNum">     617 </span>            :     const size_t kChunkSize = 8;
<span class="lineNum">     618 </span>            :     // If the array has more than kThreshold elements, we'll have to
<span class="lineNum">     619 </span>            :     // omit some details by printing only the first and the last
<span class="lineNum">     620 </span>            :     // kChunkSize elements.
<span class="lineNum">     621 </span>            :     // TODO(wan@google.com): let the user control the threshold using a flag.
<span class="lineNum">     622 </span>            :     if (len &lt;= kThreshold) {
<span class="lineNum">     623 </span>            :       PrintRawArrayTo(begin, len, os);
<span class="lineNum">     624 </span>            :     } else {
<span class="lineNum">     625 </span>            :       PrintRawArrayTo(begin, kChunkSize, os);
<span class="lineNum">     626 </span>            :       *os &lt;&lt; &quot;, ..., &quot;;
<span class="lineNum">     627 </span>            :       PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
<span class="lineNum">     628 </span>            :     }
<span class="lineNum">     629 </span>            :     *os &lt;&lt; &quot; }&quot;;
<span class="lineNum">     630 </span>            :   }
<span class="lineNum">     631 </span>            : }
<span class="lineNum">     632 </span>            : // This overload prints a (const) char array compactly.
<span class="lineNum">     633 </span>            : GTEST_API_ void UniversalPrintArray(
<span class="lineNum">     634 </span>            :     const char* begin, size_t len, ::std::ostream* os);
<span class="lineNum">     635 </span>            : 
<span class="lineNum">     636 </span>            : // This overload prints a (const) wchar_t array compactly.
<span class="lineNum">     637 </span>            : GTEST_API_ void UniversalPrintArray(
<span class="lineNum">     638 </span>            :     const wchar_t* begin, size_t len, ::std::ostream* os);
<span class="lineNum">     639 </span>            : 
<span class="lineNum">     640 </span>            : // Implements printing an array type T[N].
<span class="lineNum">     641 </span>            : template &lt;typename T, size_t N&gt;
<span class="lineNum">     642 </span>            : class UniversalPrinter&lt;T[N]&gt; {
<span class="lineNum">     643 </span>            :  public:
<span class="lineNum">     644 </span>            :   // Prints the given array, omitting some elements when there are too
<span class="lineNum">     645 </span>            :   // many.
<span class="lineNum">     646 </span>            :   static void Print(const T (&amp;a)[N], ::std::ostream* os) {
<span class="lineNum">     647 </span>            :     UniversalPrintArray(a, N, os);
<span class="lineNum">     648 </span>            :   }
<span class="lineNum">     649 </span>            : };
<span class="lineNum">     650 </span>            : 
<span class="lineNum">     651 </span>            : // Implements printing a reference type T&amp;.
<span class="lineNum">     652 </span>            : template &lt;typename T&gt;
<span class="lineNum">     653 </span>            : class UniversalPrinter&lt;T&amp;&gt; {
<span class="lineNum">     654 </span>            :  public:
<span class="lineNum">     655 </span>            :   // MSVC warns about adding const to a function type, so we want to
<span class="lineNum">     656 </span>            :   // disable the warning.
<span class="lineNum">     657 </span>            : #ifdef _MSC_VER
<span class="lineNum">     658 </span>            : # pragma warning(push)          // Saves the current warning state.
<span class="lineNum">     659 </span>            : # pragma warning(disable:4180)  // Temporarily disables warning 4180.
<a name="660"><span class="lineNum">     660 </span>            : #endif  // _MSC_VER</a>
<span class="lineNum">     661 </span>            : 
<span class="lineNum">     662 </span><span class="lineNoCov">          0 :   static void Print(const T&amp; value, ::std::ostream* os) {</span>
<span class="lineNum">     663 </span>            :     // Prints the address of the value.  We use reinterpret_cast here
<span class="lineNum">     664 </span>            :     // as static_cast doesn't compile when T is a function type.
<span class="lineNum">     665 </span><span class="lineNoCov">          0 :     *os &lt;&lt; &quot;@&quot; &lt;&lt; reinterpret_cast&lt;const void*&gt;(&amp;value) &lt;&lt; &quot; &quot;;</span>
<span class="lineNum">     666 </span>            : 
<span class="lineNum">     667 </span>            :     // Then prints the value itself.
<span class="lineNum">     668 </span><span class="lineNoCov">          0 :     UniversalPrint(value, os);</span>
<span class="lineNum">     669 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">     670 </span>            : 
<span class="lineNum">     671 </span>            : #ifdef _MSC_VER
<span class="lineNum">     672 </span>            : # pragma warning(pop)           // Restores the warning state.
<span class="lineNum">     673 </span>            : #endif  // _MSC_VER
<span class="lineNum">     674 </span>            : };
<span class="lineNum">     675 </span>            : 
<span class="lineNum">     676 </span>            : // Prints a value tersely: for a reference type, the referenced value
<span class="lineNum">     677 </span>            : // (but not the address) is printed; for a (const) char pointer, the
<span class="lineNum">     678 </span>            : // NUL-terminated string (but not the pointer) is printed.
<span class="lineNum">     679 </span>            : 
<span class="lineNum">     680 </span>            : template &lt;typename T&gt;
<a name="681"><span class="lineNum">     681 </span>            : class UniversalTersePrinter {</a>
<span class="lineNum">     682 </span>            :  public:
<span class="lineNum">     683 </span><span class="lineNoCov">          0 :   static void Print(const T&amp; value, ::std::ostream* os) {</span>
<span class="lineNum">     684 </span><span class="lineNoCov">          0 :     UniversalPrint(value, os);</span>
<span class="lineNum">     685 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">     686 </span>            : };
<span class="lineNum">     687 </span>            : template &lt;typename T&gt;
<span class="lineNum">     688 </span>            : class UniversalTersePrinter&lt;T&amp;&gt; {
<span class="lineNum">     689 </span>            :  public:
<span class="lineNum">     690 </span>            :   static void Print(const T&amp; value, ::std::ostream* os) {
<span class="lineNum">     691 </span>            :     UniversalPrint(value, os);
<span class="lineNum">     692 </span>            :   }
<span class="lineNum">     693 </span>            : };
<span class="lineNum">     694 </span>            : template &lt;typename T, size_t N&gt;
<span class="lineNum">     695 </span>            : class UniversalTersePrinter&lt;T[N]&gt; {
<span class="lineNum">     696 </span>            :  public:
<span class="lineNum">     697 </span>            :   static void Print(const T (&amp;value)[N], ::std::ostream* os) {
<span class="lineNum">     698 </span>            :     UniversalPrinter&lt;T[N]&gt;::Print(value, os);
<span class="lineNum">     699 </span>            :   }
<span class="lineNum">     700 </span>            : };
<span class="lineNum">     701 </span>            : template &lt;&gt;
<a name="702"><span class="lineNum">     702 </span>            : class UniversalTersePrinter&lt;const char*&gt; {</a>
<span class="lineNum">     703 </span>            :  public:
<span class="lineNum">     704 </span><span class="lineNoCov">          0 :   static void Print(const char* str, ::std::ostream* os) {</span>
<span class="lineNum">     705 </span><span class="lineNoCov">          0 :     if (str == NULL) {</span>
<span class="lineNum">     706 </span><span class="lineNoCov">          0 :       *os &lt;&lt; &quot;NULL&quot;;</span>
<span class="lineNum">     707 </span>            :     } else {
<span class="lineNum">     708 </span><span class="lineNoCov">          0 :       UniversalPrint(string(str), os);</span>
<span class="lineNum">     709 </span>            :     }
<span class="lineNum">     710 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">     711 </span>            : };
<span class="lineNum">     712 </span>            : template &lt;&gt;
<span class="lineNum">     713 </span>            : class UniversalTersePrinter&lt;char*&gt; {
<span class="lineNum">     714 </span>            :  public:
<span class="lineNum">     715 </span>            :   static void Print(char* str, ::std::ostream* os) {
<span class="lineNum">     716 </span>            :     UniversalTersePrinter&lt;const char*&gt;::Print(str, os);
<span class="lineNum">     717 </span>            :   }
<span class="lineNum">     718 </span>            : };
<span class="lineNum">     719 </span>            : 
<span class="lineNum">     720 </span>            : #if GTEST_HAS_STD_WSTRING
<span class="lineNum">     721 </span>            : template &lt;&gt;
<a name="722"><span class="lineNum">     722 </span>            : class UniversalTersePrinter&lt;const wchar_t*&gt; {</a>
<span class="lineNum">     723 </span>            :  public:
<span class="lineNum">     724 </span><span class="lineNoCov">          0 :   static void Print(const wchar_t* str, ::std::ostream* os) {</span>
<span class="lineNum">     725 </span><span class="lineNoCov">          0 :     if (str == NULL) {</span>
<span class="lineNum">     726 </span><span class="lineNoCov">          0 :       *os &lt;&lt; &quot;NULL&quot;;</span>
<span class="lineNum">     727 </span>            :     } else {
<span class="lineNum">     728 </span><span class="lineNoCov">          0 :       UniversalPrint(::std::wstring(str), os);</span>
<span class="lineNum">     729 </span>            :     }
<span class="lineNum">     730 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">     731 </span>            : };
<span class="lineNum">     732 </span>            : #endif
<span class="lineNum">     733 </span>            : 
<span class="lineNum">     734 </span>            : template &lt;&gt;
<span class="lineNum">     735 </span>            : class UniversalTersePrinter&lt;wchar_t*&gt; {
<span class="lineNum">     736 </span>            :  public:
<span class="lineNum">     737 </span>            :   static void Print(wchar_t* str, ::std::ostream* os) {
<span class="lineNum">     738 </span>            :     UniversalTersePrinter&lt;const wchar_t*&gt;::Print(str, os);
<span class="lineNum">     739 </span>            :   }
<span class="lineNum">     740 </span>            : };
<span class="lineNum">     741 </span>            : 
<span class="lineNum">     742 </span>            : template &lt;typename T&gt;
<span class="lineNum">     743 </span>            : void UniversalTersePrint(const T&amp; value, ::std::ostream* os) {
<span class="lineNum">     744 </span>            :   UniversalTersePrinter&lt;T&gt;::Print(value, os);
<span class="lineNum">     745 </span>            : }
<span class="lineNum">     746 </span>            : 
<span class="lineNum">     747 </span>            : // Prints a value using the type inferred by the compiler.  The
<span class="lineNum">     748 </span>            : // difference between this and UniversalTersePrint() is that for a
<span class="lineNum">     749 </span>            : // (const) char pointer, this prints both the pointer and the
<a name="750"><span class="lineNum">     750 </span>            : // NUL-terminated string.</a>
<span class="lineNum">     751 </span>            : template &lt;typename T&gt;
<span class="lineNum">     752 </span><span class="lineNoCov">          0 : void UniversalPrint(const T&amp; value, ::std::ostream* os) {</span>
<span class="lineNum">     753 </span>            :   // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
<span class="lineNum">     754 </span>            :   // UniversalPrinter with T directly.
<span class="lineNum">     755 </span>            :   typedef T T1;
<span class="lineNum">     756 </span><span class="lineNoCov">          0 :   UniversalPrinter&lt;T1&gt;::Print(value, os);</span>
<span class="lineNum">     757 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     758 </span>            : 
<span class="lineNum">     759 </span>            : #if GTEST_HAS_TR1_TUPLE
<span class="lineNum">     760 </span>            : typedef ::std::vector&lt;string&gt; Strings;
<span class="lineNum">     761 </span>            : 
<span class="lineNum">     762 </span>            : // This helper template allows PrintTo() for tuples and
<span class="lineNum">     763 </span>            : // UniversalTersePrintTupleFieldsToStrings() to be defined by
<span class="lineNum">     764 </span>            : // induction on the number of tuple fields.  The idea is that
<span class="lineNum">     765 </span>            : // TuplePrefixPrinter&lt;N&gt;::PrintPrefixTo(t, os) prints the first N
<span class="lineNum">     766 </span>            : // fields in tuple t, and can be defined in terms of
<span class="lineNum">     767 </span>            : // TuplePrefixPrinter&lt;N - 1&gt;.
<span class="lineNum">     768 </span>            : 
<span class="lineNum">     769 </span>            : // The inductive case.
<span class="lineNum">     770 </span>            : template &lt;size_t N&gt;
<span class="lineNum">     771 </span>            : struct TuplePrefixPrinter {
<a name="772"><span class="lineNum">     772 </span>            :   // Prints the first N fields of a tuple.</a>
<span class="lineNum">     773 </span>            :   template &lt;typename Tuple&gt;
<span class="lineNum">     774 </span><span class="lineNoCov">          0 :   static void PrintPrefixTo(const Tuple&amp; t, ::std::ostream* os) {</span>
<span class="lineNum">     775 </span><span class="lineNoCov">          0 :     TuplePrefixPrinter&lt;N - 1&gt;::PrintPrefixTo(t, os);</span>
<span class="lineNum">     776 </span><span class="lineNoCov">          0 :     *os &lt;&lt; &quot;, &quot;;</span>
<span class="lineNum">     777 </span><span class="lineNoCov">          0 :     UniversalPrinter&lt;typename ::std::tr1::tuple_element&lt;N - 1, Tuple&gt;::type&gt;</span>
<span class="lineNum">     778 </span><span class="lineNoCov">          0 :         ::Print(::std::tr1::get&lt;N - 1&gt;(t), os);</span>
<span class="lineNum">     779 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">     780 </span>            : 
<span class="lineNum">     781 </span>            :   // Tersely prints the first N fields of a tuple to a string vector,
<span class="lineNum">     782 </span>            :   // one element for each field.
<span class="lineNum">     783 </span>            :   template &lt;typename Tuple&gt;
<span class="lineNum">     784 </span>            :   static void TersePrintPrefixToStrings(const Tuple&amp; t, Strings* strings) {
<span class="lineNum">     785 </span>            :     TuplePrefixPrinter&lt;N - 1&gt;::TersePrintPrefixToStrings(t, strings);
<span class="lineNum">     786 </span>            :     ::std::stringstream ss;
<span class="lineNum">     787 </span>            :     UniversalTersePrint(::std::tr1::get&lt;N - 1&gt;(t), &amp;ss);
<span class="lineNum">     788 </span>            :     strings-&gt;push_back(ss.str());
<span class="lineNum">     789 </span>            :   }
<span class="lineNum">     790 </span>            : };
<span class="lineNum">     791 </span>            : 
<span class="lineNum">     792 </span>            : // Base cases.
<span class="lineNum">     793 </span>            : template &lt;&gt;
<a name="794"><span class="lineNum">     794 </span>            : struct TuplePrefixPrinter&lt;0&gt; {</a>
<span class="lineNum">     795 </span>            :   template &lt;typename Tuple&gt;
<span class="lineNum">     796 </span><span class="lineNoCov">          0 :   static void PrintPrefixTo(const Tuple&amp;, ::std::ostream*) {}</span>
<span class="lineNum">     797 </span>            : 
<span class="lineNum">     798 </span>            :   template &lt;typename Tuple&gt;
<span class="lineNum">     799 </span>            :   static void TersePrintPrefixToStrings(const Tuple&amp;, Strings*) {}
<span class="lineNum">     800 </span>            : };
<span class="lineNum">     801 </span>            : // We have to specialize the entire TuplePrefixPrinter&lt;&gt; class
<span class="lineNum">     802 </span>            : // template here, even though the definition of
<span class="lineNum">     803 </span>            : // TersePrintPrefixToStrings() is the same as the generic version, as
<span class="lineNum">     804 </span>            : // Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
<span class="lineNum">     805 </span>            : // support specializing a method template of a class template.
<span class="lineNum">     806 </span>            : template &lt;&gt;
<a name="807"><span class="lineNum">     807 </span>            : struct TuplePrefixPrinter&lt;1&gt; {</a>
<span class="lineNum">     808 </span>            :   template &lt;typename Tuple&gt;
<span class="lineNum">     809 </span><span class="lineNoCov">          0 :   static void PrintPrefixTo(const Tuple&amp; t, ::std::ostream* os) {</span>
<span class="lineNum">     810 </span><span class="lineNoCov">          0 :     UniversalPrinter&lt;typename ::std::tr1::tuple_element&lt;0, Tuple&gt;::type&gt;::</span>
<span class="lineNum">     811 </span><span class="lineNoCov">          0 :         Print(::std::tr1::get&lt;0&gt;(t), os);</span>
<span class="lineNum">     812 </span><span class="lineNoCov">          0 :   }</span>
<span class="lineNum">     813 </span>            : 
<span class="lineNum">     814 </span>            :   template &lt;typename Tuple&gt;
<span class="lineNum">     815 </span>            :   static void TersePrintPrefixToStrings(const Tuple&amp; t, Strings* strings) {
<span class="lineNum">     816 </span>            :     ::std::stringstream ss;
<span class="lineNum">     817 </span>            :     UniversalTersePrint(::std::tr1::get&lt;0&gt;(t), &amp;ss);
<span class="lineNum">     818 </span>            :     strings-&gt;push_back(ss.str());
<span class="lineNum">     819 </span>            :   }
<span class="lineNum">     820 </span>            : };
<span class="lineNum">     821 </span>            : 
<span class="lineNum">     822 </span>            : // Helper function for printing a tuple.  T must be instantiated with
<a name="823"><span class="lineNum">     823 </span>            : // a tuple type.</a>
<span class="lineNum">     824 </span>            : template &lt;typename T&gt;
<span class="lineNum">     825 </span><span class="lineNoCov">          0 : void PrintTupleTo(const T&amp; t, ::std::ostream* os) {</span>
<span class="lineNum">     826 </span><span class="lineNoCov">          0 :   *os &lt;&lt; &quot;(&quot;;</span>
<span class="lineNum">     827 </span><span class="lineNoCov">          0 :   TuplePrefixPrinter&lt; ::std::tr1::tuple_size&lt;T&gt;::value&gt;::</span>
<span class="lineNum">     828 </span>            :       PrintPrefixTo(t, os);
<span class="lineNum">     829 </span><span class="lineNoCov">          0 :   *os &lt;&lt; &quot;)&quot;;</span>
<span class="lineNum">     830 </span><span class="lineNoCov">          0 : }</span>
<span class="lineNum">     831 </span>            : 
<span class="lineNum">     832 </span>            : // Prints the fields of a tuple tersely to a string vector, one
<span class="lineNum">     833 </span>            : // element for each field.  See the comment before
<span class="lineNum">     834 </span>            : // UniversalTersePrint() for how we define &quot;tersely&quot;.
<span class="lineNum">     835 </span>            : template &lt;typename Tuple&gt;
<span class="lineNum">     836 </span>            : Strings UniversalTersePrintTupleFieldsToStrings(const Tuple&amp; value) {
<span class="lineNum">     837 </span>            :   Strings result;
<span class="lineNum">     838 </span>            :   TuplePrefixPrinter&lt; ::std::tr1::tuple_size&lt;Tuple&gt;::value&gt;::
<span class="lineNum">     839 </span>            :       TersePrintPrefixToStrings(value, &amp;result);
<span class="lineNum">     840 </span>            :   return result;
<span class="lineNum">     841 </span>            : }
<span class="lineNum">     842 </span>            : #endif  // GTEST_HAS_TR1_TUPLE
<span class="lineNum">     843 </span>            : 
<span class="lineNum">     844 </span>            : }  // namespace internal
<a name="845"><span class="lineNum">     845 </span>            : </a>
<span class="lineNum">     846 </span>            : template &lt;typename T&gt;
<span class="lineNum">     847 </span><span class="lineNoCov">          0 : ::std::string PrintToString(const T&amp; value) {</span>
<span class="lineNum">     848 </span><span class="lineNoCov">          0 :   ::std::stringstream ss;</span>
<span class="lineNum">     849 </span><span class="lineNoCov">          0 :   internal::UniversalTersePrinter&lt;T&gt;::Print(value, &amp;ss);</span>
<span class="lineNum">     850 </span><span class="lineNoCov">          0 :   return ss.str();</span>
<span class="lineNum">     851 </span>            : }
<span class="lineNum">     852 </span>            : 
<span class="lineNum">     853 </span>            : }  // namespace testing
<span class="lineNum">     854 </span>            : 
<span class="lineNum">     855 </span>            : #endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.11</a></td></tr>
  </table>
  <br>

</body>
</html>
